/*
package NiuKe;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

*/
/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/06/13/19:31
 *//*

public class HJ101 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        List<Integer> list = new ArrayList<>();
        for(int i=0;i<num;i++){
            list.add(scanner.nextInt());
        }
        int order = scanner.nextInt();
        if(order == 0){
            Collections.sort(list);
        }else{
            Collections.sort(list,Collections.reverseOrder());
        }
        for (int integer = 0;integer<list.size();integer++) {
            System.out.print(list.get(integer)+" ");
        }

    }
}
*/
